
<html>
<head>
    <meta charset="UTF-8"/>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">


    <title>后台管理系统</title>
    <link rel="stylesheet" href="/res/layui/css/layui.css">
    <link rel="stylesheet" href="/res/css/global.css">
</head>
<body>

<!-- 网页头部 -->
<div class="fly-header layui-bg-black">
    <!--#include virtual="/include/top.html" -->
</div>
<!-- 头部结束 -->

<!-- 滚动图片 -->
<div class="layui-container">
<div class="fly-panel">
    <div class="layui-carousel" id="test1">
        <div carousel-item>
            <!--#include virtual="/pages/comm/carousel.html" -->
        </div>
    </div>
</div>
</div>
<!-- 滚动图片结束 -->


<div class="layui-container">
<div class="layui-row layui-col-space15">
    <div class="layui-col-md3">
        <!--#include virtual="/pages/lxfs/lxfstp.html" -->
    </div>
    <div class="layui-col-md9">
        <!--#include virtual="/pages/msg/msg.html" -->
    </div>
</div>
</div>

<!--友情链接-->
<div class="layui-container">
    <!--#include virtual="/pages/comm/link.html"-->
</div>


<div class="fly-footer">
    <!--#include virtual="/include/footer.html" -->
</div>

</body>


<script src="/res/layui/layui.js"></script>


<script>

  layui.use('carousel', function() {
        var carousel = layui.carousel;
        //建造实例
        carousel.render({
            elem: '#test1',
            width: '100%' //设置容器宽度
                ,
            height: '240px',
            arrow: 'always' //始终显示箭头
                //,anim: 'updown' //切换动画方式
        });
    });

    layui.use('element', function(){
    var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块
    
    //监听导航点击
    element.on('nav(demo)', function(elem){
        //console.log(elem)
        layer.msg(elem.text());
    });
    });

    layui.use(['form','laydate','upload','layedit'],function () {
        var $ = layui.jquery;
        var form = layui.form;
        // var layer = layui.layer;
        var upload = layui.upload; // 获取upload模块
        var layedit=layui.layedit;

        edit=function () {
            var url="http://www.qhjinquan.cn/wxcms/msg/save";
            // var url="http://localhost:8090/wxcms/msg/save";
            // $("#linkForm").attr("action",url).submit();
            var content_index=layedit.build('msg_content');
                $.ajax({
                    type : 'post',
                    async : false,//同步请求，执行成功后才会继续执行后面的代码
                    url : url,
                    dataType:'json',
                    contentType:'application/x-www-form-urlencoded;charset=UTF-8',
                    data : {
                        msg_user : $("#msg_user").val(),
                        msg_phone : $("#msg_phone").val(),
                        msg_address : $("#msg_address").val(),
                        msg_title : $("#msg_title").val(),
                        msg_content : layedit.getContent(content_index),
                    },
                    success : function (response) {
                        alert(response.msg);
                        // layer.alert(response.msg);
                        // $('#MsgForm')[0].reset();
                        // window.location.reload();
                    },
                    error : function (response) {
                        alert(response.msg);
                        // layer.alert(response.msg);
                        // window.location.reload();         
                    }
                });
                return true;
            }
    })
</script>
</html>
